import { createRouter, createWebHistory } from "vue-router";
import IndexView from '../view/IndexView.vue'
import NotFound from '../view/NotFound.vue'
import LoginView from "../view/LoginView.vue";
import RegisterView from "../view/RegisterView.vue";

const routes = [
    {
        path: '/',
        redirect: '/index'
    },
    {
        path: '/index',
        name: 'index',
        component: IndexView,
    },
    {
        path: '/login',
        name: 'login',
        component: LoginView,
    },
    {
        path: '/register',
        name: 'register',
        component: RegisterView,
    },
    {
        path: '/404',
        name: '404',
        component: NotFound,
    },
    {
        path: '/:catchAll(.*)',
        redirect: '/404'
    }

]

const router = createRouter({
    history: createWebHistory(),
    routes: routes
})

export default router